<template>
    <div>
        <el-card>

        <el-table  :data="signupList" border stripe>
      <el-table-column label="活动编号" type="index>" prop="vno"></el-table-column>
      <el-tableColumn label="活动名称" prop="vname"></el-tableColumn>
      <el-tableColumn label="报名者编号" prop="parid"></el-tableColumn>
    
      <el-tableColumn label="操作" with="180px">
        <template slot-scope="scope">
         <el-button type="primary" icon="el-icon-edit" size="mini" @click="confirmsignup(scope.row.parid)">确认参与</el-button>
        
        </template>
      </el-tableColumn>
    </el-table>
    </el-card>
    </div>
</template>
<script>
export default {
       props:['vno'],
       data(){
        return {
          signupList:{},
         
        }
       },
       created(){
        this.getSignupList()
       },
       methods:{
           getSignupList(){
            this.axios({
                url:'/api/signup/detail',
                method:"get",
                params:{
                    vno:this.vno,
            }
        })
          .then(res=>{
                if(res.data.code==0){
                    this.signupList=res.data.data
                }else{
                    alert(res.data.msg)
                }
            })
            console.log(this.vno)
       
              
           },
           confirmsignup(parid){
            this.$confirm(
      '是否确定执行该操作',
      '提示',
      {confirmButtonText:'确定',
    cancelButtonText:'取消',
  type:"warning",}
    ).then(()=>{
		
      this.axios({     // axios 向后端发起请求
            url: "/api/signup/hour",  // 请求地址
            method: "post",             // 请求方法
            headers: {                  // 请求头
              "Content-Type": "application/json",
            },
            params: { // 请求参数，为 data，与登录的 params 不太一样
             parstate:1,
             vno:this.vno,
             parid:parid,
            },
          })
        .then((response) => {
			
          if(response.data.data==1){
            console.log("已成功参与")
          this.$message.success('确认参与成功！')
          
          }
        })

  })
           },
       }
    }
</script>